package org.wattdepot.simulation.basic;

import java.util.Calendar;

/**
 * Defines a SystemTime object.
 * 
 * @author BaoHuy Ung, Alan Lee, Edwin Lim, and Anthony Xu.
 * 
 */
public class SystemTime {

  /** Holds calendar object. */
  private Calendar time;

  /**
   * Constructor for SystemTime object.
   * 
   */
  public SystemTime() {
    time = Calendar.getInstance();
  }

  /**
   * Returns the year.
   * 
   * @return Year value.
   */
  public int getYear() {
    return time.get(Calendar.YEAR);
  }

  /**
   * Returns the month.
   * 
   * @return Month value.
   */
  public int getMonth() {
    return time.get(Calendar.MONTH) + 1;
  }

  /**
   * Returns the day.
   * 
   * @return Day value.
   */
  public int getDay() {
    return time.get(Calendar.DAY_OF_MONTH);
  }

  /**
   * Returns the hour.
   * 
   * @return Hour value.
   */
  public int getHour() {
    return time.get(Calendar.HOUR_OF_DAY);
  }

  /**
   * Returns the minute.
   * 
   * @return Minute value.
   */
  public int getMinute() {
    return time.get(Calendar.MINUTE);
  }

  /**
   * Returns the second.
   * 
   * @return Second value.
   */
  public int getSecond() {
    return time.get(Calendar.SECOND);
  }
}
